package demo12;

import java.lang.reflect.Constructor;

public class Main {
    public static void main(String[] args) throws Exception {
        //1、获取Person类的字节码文件
        Class<Person> personClass = Person.class;
        //2、通过字节码文件获取构造函数
        Constructor<Person> constructor = personClass.getConstructor();
        //3、通过构造函数创建对象
        Person person = constructor.newInstance();
    }
}
